#ifndef PLAN_H
#define PLAN_H


#include "vector3d.h"

/**
 * \file	plan.h
 * \brief	Declaration de la classe Plan representant un plan par les quatres parametres de son equation.
 */


class Plan
{
	/*!
	 * \class Plan
	 * \brief Classe représentant un plan dans l'espace grace aux parametres de son equation ax+by+cz+d=0.
	 *
	 */
	
	private :
		double a;			/*! Parameter of the plan equation. */
		double b;			/*! Parameter of the plan equation. */
		double c;			/*! Parameter of the plan equation. */
		double d;			/*! Parameter of the plan equation. */
		
	public:
		/*!
		*  \brief Default constructor of the Plan class.
		*
		*  Default constructor of the Plan class : Every attributes are initialized to 0 (int,float,double,...) NULL (pointers) or are cleared (lists, stacks, ...).
		*/
		Plan();
		
		/*!
		*  \brief Overloading constructor of the plan class.
		*
		*  Creates a plan given a point in it and its normal direction.
		*  
		*  \param _p : Point in the plan.
		*  \param _v : Vector giving the plan's normal direction.
		*/
		Plan( Vector3D _p, Vector3D _v );
		
		/*!
		*  \brief Copy constructor of the Plan class.
		*
		*  Copy constructor of the Plan class.
		*/
		Plan( const Plan& _p );
		
		/*!
		*  \brief Destructor of the Plan class.
		*
		*  Destructor of the Plan class.
		*/
		~Plan();
		
		/*!
		*  \brief Affectation operator of the Plan class.
		*
		*  Affectation operator of the Plan class.
		*/
		Plan& operator= ( const Plan& _p );
		
		/*!
		*  \brief Getter of the Plan class.
		*
		*  Getter of the Plan class.
		*
		*  \return (double) Returns the a parameter of the plan's equation.
		*/
		double getA ();
		
		/*!
		*  \brief Getter of the Plan class.
		*
		*  Getter of the Plan class.
		*
		*  \return (double) Returns the a parameter of the plan's equation.
		*/
		double getB ();
		
		/*!
		*  \brief Getter of the Plan class.
		*
		*  Getter of the Plan class.
		*
		*  \return (double) Returns the a parameter of the plan's equation.
		*/
		double getC ();
		
		/*!
		*  \brief Getter of the Plan class.
		*
		*  Getter of the Plan class.
		*
		*  \return (double) Returns the a parameter of the plan's equation.
		*/
		double getD ();
		
		/*!
		*  \brief Setter of the Plan class.
		*
		*  Setter of the Plan class.
		*
		*  \param _a : a parameter to attribute to the plan.
		*
		*  \return (void)
		*/
		void setA ( double _a );
		
		/*!
		*  \brief Setter of the Plan class.
		*
		*  Setter of the Plan class.
		*
		*  \param _b : b parameter to attribute to the plan.
		*
		*  \return (void)
		*/
		void setB ( double _b );
		
		/*!
		*  \brief Setter of the Plan class.
		*
		*  Setter of the Plan class.
		*
		*  \param _c : c parameter to attribute to the plan.
		*
		*  \return (void)
		*/
		void setC ( double _c );
		
		/*!
		*  \brief Setter of the Plan class.
		*
		*  Setter of the Plan class.
		*
		*  \param _d : d parameter to attribute to the plan.
		*
		*  \return (void)
		*/
		void setD ( double _d );
		
		/*!
		*  \brief Computes the euclidian distance between a point and a plan.
		*
		*  Computes the euclidian distance between a point and a plan.
		*
		*  \param _p : Point we want to know the distance.
		*
		*  \return (double) Returns the euclidian distance between the point and the plan.
		*/
		double distance ( Vector3D _p );
		
		/*!
		*  \brief Computes the signed distance between a point and a plan.
		*
		*  Computes the euclidian distance between a point and a plan, the sign of the result indicates wether the point _p lies on the same side of the plan than the normal or not.
		*
		*  \param _p : Point we want to know the distance.
		*
		*  \return (double) Returns the signed distance between the point and the plan.
		*/
		double signedDistance ( Vector3D _p );
};

#endif
